﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleTest
{
    class Program
    {
        static void Main(string[] args)
        {

            IList<Student> students = new List<Student>();
            students.Add(new Student
            {
                Id = "12345",
                Name = "siX",
                Faculty = "Electrical Engineering",
                Major = "Power"

            });

            students.Add(new Student
            {
                Id = "12346",
                Name = "siY",
                Faculty = "Electrical Engineering",
                Major = "Sains"

            });

            students.Add(new Student
            {
                Id = "12347",
                Name = "siA",
                Faculty = "Informatics Engineering",
                Major = "Information System"

            });

            int numbers = students.Count(s => s.Faculty == "Electrical Engineering");
            Console.WriteLine(numbers);



            //IList<Point> points = new List<Point>();
            //points.Add(new Point { x = 1, y = 2 });
            //points.Add(new Point { x = 1, y = 3 });
            //points.Add(new Point { x = 1, y = 4 });
            //points.Add(new Point { x = 2, y = 2 });
            //points.Add(new Point { x = 2, y = 3 });

            //var pointsx1 = points.Where(p => p.x ==1);

            //foreach (var point in pointsx1)
            //{
            //    System.Console.WriteLine("Point X={0}, Y={1}", point.x, point.y);
            //}
            //int[] numbers = new int[7] { 0, 1, 2, 3, 4, 5, 6 };

            //List<int> eventNumbers = new List<int>();

            //for (int i = 0; i < numbers.Length; i++)
            //{
            //    if (numbers[i] % 2 == 0)
            //    {
            //        eventNumbers.Add(numbers[i]);
            //    }
            //}

            //var eventNumbers = numbers.Where(num => num % 2 == 0);

            //foreach (int num in eventNumbers)
            //{ 
            //    Console.WriteLine(eventNumbers);
            //}


        }


    }
}
